using SM.core;
using SS;
using SS.core;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using TVSGPP.search;
using TVSGPP.tools;
namespace TVSBH.func
{
	public class frmOrder : Form
	{
		private IContainer components = null;
		private GroupBox groupBox3;
		private DataGridView dgvBill;
		private Button btnClose;
		private Button btnDel;
		private Button btnPrint;
		private Button btnSave;
		private Button btnEdit;
		private Button btnAdd;
		private DataGridView dgvProduct;
		private GroupBox groupBox1;
		private Label label2;
		private DateTimePicker txtDate;
		private TextBox txtID;
		private Label label1;
		private Label label6;
		private TextBox txtNote;
		private Button btnSelect;
		private Button btnAddToBill;
		private TextBox txtProductUnit;
		private TextBox txtProductName;
		private ToolTip toolTip1;
		private ContextMenuStrip cmsBill;
		private ToolStripMenuItem cmsDelProduct;
		private ToolStripSeparator toolStripSeparator1;
		private ToolStripMenuItem cmsAddBill;
		private ToolStripMenuItem cmsEditBill;
		private ToolStripSeparator toolStripSeparator2;
		private ToolStripMenuItem cmsSaveBill;
		private ToolStripMenuItem cmsPrintBill;
		private ToolStripMenuItem cmsDellBill;
		private ToolStripMenuItem cmsAddProduct;
		private ToolStripSeparator toolStripSeparator4;
		private Label label25;
		private Label label17;
		private Button btnSearchTime;
		private DateTimePicker dtpTo;
		private DateTimePicker dtpFrom;
		private Button lblProduct;
		private Button lblMoney;
		private Button lblNumber;
		private Button lblUnit;
		private Label label4;
		private Label label22;
		private ContextMenuStrip ctmBill;
		private ToolStripMenuItem ctmBillAdd;
		private ToolStripMenuItem ctmBillEdit;
		private ToolStripSeparator toolStripSeparator5;
		private ToolStripMenuItem ctmBillPrint;
		private ToolStripMenuItem ctmBillDel;
		private ToolStripSeparator toolStripSeparator6;
		private ToolStripMenuItem ctmBillSearchAdvance;
		private NumericUpDown txtProductNumber;
		private BindingNavigator bindingNavigator1;
		private ToolStripLabel bindingNavigatorCountItem;
		private ToolStripButton bindingNavigatorMoveFirstItem;
		private ToolStripButton bindingNavigatorMovePreviousItem;
		private ToolStripSeparator bindingNavigatorSeparator;
		private ToolStripTextBox bindingNavigatorPositionItem;
		private ToolStripSeparator bindingNavigatorSeparator1;
		private ToolStripButton bindingNavigatorMoveNextItem;
		private ToolStripButton bindingNavigatorMoveLastItem;
		private ToolStripSeparator bindingNavigatorSeparator2;
		private DataGridViewTextBoxColumn ID;
		private DataGridViewTextBoxColumn CreateDate;
		private DataGridViewTextBoxColumn Note;
		private DataGridViewTextBoxColumn PID;
		private DataGridViewTextBoxColumn CUserName;
		private DataGridViewTextBoxColumn CFullName;
		private ComboBox cbbNational;
		private DataGridViewTextBoxColumn productName;
		private DataGridViewTextBoxColumn productUnit;
		private DataGridViewTextBoxColumn productNumber;
		private DataGridViewTextBoxColumn ProductID;
		private DataGridViewTextBoxColumn NationalID;
		private ComboBox cbbProvider;
		private Label label5;
		private Button lblBottom;
		private Func objFunc = new Func();
		public string userName = "";
		public string fullName = "";
		public string currDortorID = "";
		public string currCusID = "0";
		public string currPid = "";
		private customers objCus = new customers();
		private products objProduct = new products();
		private Order objOrder = new Order();
		private DataTable objProductTable = new DataTable();
		private bool AllowSellSuppen = false;
		private int currIndex = -1;
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmOrder));
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			this.groupBox3 = new GroupBox();
			this.label25 = new Label();
			this.label17 = new Label();
			this.btnSearchTime = new Button();
			this.dtpTo = new DateTimePicker();
			this.dtpFrom = new DateTimePicker();
			this.dgvBill = new DataGridView();
			this.ID = new DataGridViewTextBoxColumn();
			this.CreateDate = new DataGridViewTextBoxColumn();
			this.Note = new DataGridViewTextBoxColumn();
			this.PID = new DataGridViewTextBoxColumn();
			this.CUserName = new DataGridViewTextBoxColumn();
			this.CFullName = new DataGridViewTextBoxColumn();
			this.ctmBill = new ContextMenuStrip(this.components);
			this.ctmBillAdd = new ToolStripMenuItem();
			this.ctmBillEdit = new ToolStripMenuItem();
			this.toolStripSeparator5 = new ToolStripSeparator();
			this.ctmBillPrint = new ToolStripMenuItem();
			this.ctmBillDel = new ToolStripMenuItem();
			this.toolStripSeparator6 = new ToolStripSeparator();
			this.ctmBillSearchAdvance = new ToolStripMenuItem();
			this.btnClose = new Button();
			this.btnDel = new Button();
			this.btnPrint = new Button();
			this.btnSave = new Button();
			this.btnEdit = new Button();
			this.btnAdd = new Button();
			this.dgvProduct = new DataGridView();
			this.productName = new DataGridViewTextBoxColumn();
			this.productUnit = new DataGridViewTextBoxColumn();
			this.productNumber = new DataGridViewTextBoxColumn();
			this.ProductID = new DataGridViewTextBoxColumn();
			this.NationalID = new DataGridViewTextBoxColumn();
			this.cmsBill = new ContextMenuStrip(this.components);
			this.cmsAddProduct = new ToolStripMenuItem();
			this.toolStripSeparator4 = new ToolStripSeparator();
			this.cmsDelProduct = new ToolStripMenuItem();
			this.toolStripSeparator1 = new ToolStripSeparator();
			this.cmsAddBill = new ToolStripMenuItem();
			this.cmsEditBill = new ToolStripMenuItem();
			this.toolStripSeparator2 = new ToolStripSeparator();
			this.cmsSaveBill = new ToolStripMenuItem();
			this.cmsPrintBill = new ToolStripMenuItem();
			this.cmsDellBill = new ToolStripMenuItem();
			this.groupBox1 = new GroupBox();
			this.cbbProvider = new ComboBox();
			this.label5 = new Label();
			this.txtNote = new TextBox();
			this.label6 = new Label();
			this.label2 = new Label();
			this.txtDate = new DateTimePicker();
			this.txtID = new TextBox();
			this.label1 = new Label();
			this.btnSelect = new Button();
			this.txtProductUnit = new TextBox();
			this.txtProductName = new TextBox();
			this.btnAddToBill = new Button();
			this.toolTip1 = new ToolTip(this.components);
			this.lblProduct = new Button();
			this.lblMoney = new Button();
			this.lblNumber = new Button();
			this.lblUnit = new Button();
			this.label4 = new Label();
			this.label22 = new Label();
			this.txtProductNumber = new NumericUpDown();
			this.bindingNavigator1 = new BindingNavigator(this.components);
			this.bindingNavigatorCountItem = new ToolStripLabel();
			this.bindingNavigatorMoveFirstItem = new ToolStripButton();
			this.bindingNavigatorMovePreviousItem = new ToolStripButton();
			this.bindingNavigatorSeparator = new ToolStripSeparator();
			this.bindingNavigatorPositionItem = new ToolStripTextBox();
			this.bindingNavigatorSeparator1 = new ToolStripSeparator();
			this.bindingNavigatorMoveNextItem = new ToolStripButton();
			this.bindingNavigatorMoveLastItem = new ToolStripButton();
			this.bindingNavigatorSeparator2 = new ToolStripSeparator();
			this.cbbNational = new ComboBox();
			this.lblBottom = new Button();
			this.groupBox3.SuspendLayout();
			((ISupportInitialize)this.dgvBill).BeginInit();
			this.ctmBill.SuspendLayout();
			((ISupportInitialize)this.dgvProduct).BeginInit();
			this.cmsBill.SuspendLayout();
			this.groupBox1.SuspendLayout();
			((ISupportInitialize)this.txtProductNumber).BeginInit();
			((ISupportInitialize)this.bindingNavigator1).BeginInit();
			this.bindingNavigator1.SuspendLayout();
			base.SuspendLayout();
			this.groupBox3.Controls.Add(this.label25);
			this.groupBox3.Controls.Add(this.label17);
			this.groupBox3.Controls.Add(this.btnSearchTime);
			this.groupBox3.Controls.Add(this.dtpTo);
			this.groupBox3.Controls.Add(this.dtpFrom);
			this.groupBox3.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox3.Location = new System.Drawing.Point(8, 5);
			this.groupBox3.Name = "groupBox3";
			this.groupBox3.Size = new Size(220, 80);
			this.groupBox3.TabIndex = 42;
			this.groupBox3.TabStop = false;
			this.groupBox3.Text = "Tìm kiếm";
			this.label25.AutoSize = true;
			this.label25.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.label25.Location = new System.Drawing.Point(5, 22);
			this.label25.Name = "label25";
			this.label25.Size = new Size(22, 15);
			this.label25.TabIndex = 157;
			this.label25.Text = "Từ";
			this.label17.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
//			this.label17.Image = (Image)componentResourceManager.GetObject("label17.Image");
			this.label17.Location = new System.Drawing.Point(113, 17);
			this.label17.Name = "label17";
			this.label17.Size = new Size(20, 25);
			this.label17.TabIndex = 156;
			this.btnSearchTime.FlatAppearance.BorderColor = Color.FromArgb(0, 192, 192);
			this.btnSearchTime.FlatStyle = FlatStyle.Flat;
			this.btnSearchTime.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnSearchTime.Location = new System.Drawing.Point(8, 46);
			this.btnSearchTime.Name = "btnSearchTime";
			this.btnSearchTime.Size = new Size(206, 28);
			this.btnSearchTime.TabIndex = 155;
			this.btnSearchTime.Text = "Tìm kiếm đơn thuốc";
			this.btnSearchTime.UseVisualStyleBackColor = true;
			this.btnSearchTime.Click += new EventHandler(this.btnSearchTime_Click);
			this.dtpTo.CustomFormat = "dd/MM/yyyy";
			this.dtpTo.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dtpTo.Format = DateTimePickerFormat.Custom;
			this.dtpTo.Location = new System.Drawing.Point(135, 19);
			this.dtpTo.Name = "dtpTo";
			this.dtpTo.Size = new Size(81, 21);
			this.dtpTo.TabIndex = 154;
			this.dtpFrom.CustomFormat = "dd/MM/yyyy";
			this.dtpFrom.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dtpFrom.Format = DateTimePickerFormat.Custom;
			this.dtpFrom.Location = new System.Drawing.Point(29, 19);
			this.dtpFrom.Name = "dtpFrom";
			this.dtpFrom.Size = new Size(81, 21);
			this.dtpFrom.TabIndex = 153;
			this.dgvBill.AllowUserToAddRows = false;
			this.dgvBill.AllowUserToDeleteRows = false;
			this.dgvBill.AllowUserToOrderColumns = true;
			this.dgvBill.AllowUserToResizeColumns = false;
			this.dgvBill.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvBill.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvBill.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
			this.dgvBill.BackgroundColor = Color.White;
			this.dgvBill.BorderStyle = BorderStyle.Fixed3D;
			this.dgvBill.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvBill.Columns.AddRange(new DataGridViewColumn[]
			{
				this.ID,
				this.CreateDate,
				this.Note,
				this.PID,
				this.CUserName,
				this.CFullName
			});
			this.dgvBill.ContextMenuStrip = this.ctmBill;
			this.dgvBill.Cursor = Cursors.Hand;
			this.dgvBill.EnableHeadersVisualStyles = false;
			this.dgvBill.Location = new System.Drawing.Point(7, 116);
			this.dgvBill.MultiSelect = false;
			this.dgvBill.Name = "dgvBill";
			this.dgvBill.ReadOnly = true;
			this.dgvBill.RowHeadersVisible = false;
			this.dgvBill.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvBill.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvBill.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvBill.Size = new Size(220, 478);
			this.dgvBill.TabIndex = 41;
			this.dgvBill.CellEnter += new DataGridViewCellEventHandler(this.dgvBill_CellEnter);
			this.ID.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.ID.DataPropertyName = "ID";
			this.ID.HeaderText = "Đơn hàng";
			this.ID.MinimumWidth = 120;
			this.ID.Name = "ID";
			this.ID.ReadOnly = true;
			this.CreateDate.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.CreateDate.DataPropertyName = "CreateDate";
			dataGridViewCellStyle2.Format = "D";
			dataGridViewCellStyle2.NullValue = null;
			this.CreateDate.DefaultCellStyle = dataGridViewCellStyle2;
			this.CreateDate.HeaderText = "Ngày lập";
			this.CreateDate.MinimumWidth = 88;
			this.CreateDate.Name = "CreateDate";
			this.CreateDate.ReadOnly = true;
			this.CreateDate.Width = 88;
			this.Note.DataPropertyName = "Note";
			this.Note.HeaderText = "Note";
			this.Note.Name = "Note";
			this.Note.ReadOnly = true;
			this.Note.Visible = false;
			this.PID.DataPropertyName = "PID";
			this.PID.HeaderText = "PID";
			this.PID.Name = "PID";
			this.PID.ReadOnly = true;
			this.PID.Visible = false;
			this.CUserName.DataPropertyName = "UserName";
			this.CUserName.HeaderText = "UserName";
			this.CUserName.Name = "CUserName";
			this.CUserName.ReadOnly = true;
			this.CUserName.Visible = false;
			this.CFullName.DataPropertyName = "FullName";
			this.CFullName.HeaderText = "FullName";
			this.CFullName.Name = "CFullName";
			this.CFullName.ReadOnly = true;
			this.CFullName.Visible = false;
			this.ctmBill.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.ctmBill.Items.AddRange(new ToolStripItem[]
			{
				this.ctmBillAdd,
				this.ctmBillEdit,
				this.toolStripSeparator5,
				this.ctmBillPrint,
				this.ctmBillDel,
				this.toolStripSeparator6,
				this.ctmBillSearchAdvance
			});
			this.ctmBill.Name = "ctmBill";
			this.ctmBill.Size = new Size(180, 126);
			this.ctmBillAdd.Name = "ctmBillAdd";
			this.ctmBillAdd.Size = new Size(179, 22);
			this.ctmBillAdd.Text = "Tạo đơn đặt hàng";
			this.ctmBillAdd.Click += new EventHandler(this.ctmBillAdd_Click);
			this.ctmBillEdit.Name = "ctmBillEdit";
			this.ctmBillEdit.Size = new Size(179, 22);
			this.ctmBillEdit.Text = "Sửa đơn đặt hàng";
			this.ctmBillEdit.Click += new EventHandler(this.ctmBillEdit_Click);
			this.toolStripSeparator5.Name = "toolStripSeparator5";
			this.toolStripSeparator5.Size = new Size(176, 6);
			this.ctmBillPrint.Name = "ctmBillPrint";
			this.ctmBillPrint.Size = new Size(179, 22);
			this.ctmBillPrint.Text = "In đơn đặt hàng";
			this.ctmBillPrint.Click += new EventHandler(this.ctmBillPrint_Click);
			this.ctmBillDel.Name = "ctmBillDel";
			this.ctmBillDel.Size = new Size(179, 22);
			this.ctmBillDel.Text = "Xoá đơn đặt hàng";
			this.ctmBillDel.Click += new EventHandler(this.ctmBillDel_Click);
			this.toolStripSeparator6.Name = "toolStripSeparator6";
			this.toolStripSeparator6.Size = new Size(176, 6);
			this.ctmBillSearchAdvance.Name = "ctmBillSearchAdvance";
			this.ctmBillSearchAdvance.Size = new Size(179, 22);
			this.ctmBillSearchAdvance.Text = "Tìm kiếm nâng cao";
			this.btnClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnClose.Cursor = Cursors.Hand;
			this.btnClose.FlatAppearance.BorderColor = Color.FromArgb(192, 192, 255);
			this.btnClose.FlatStyle = FlatStyle.Flat;
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(844, 564);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(97, 26);
			this.btnClose.TabIndex = 48;
			this.btnClose.Text = "Thoát [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.btnDel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnDel.Cursor = Cursors.Hand;
			this.btnDel.Enabled = false;
			this.btnDel.FlatAppearance.BorderColor = Color.FromArgb(192, 192, 255);
			this.btnDel.FlatStyle = FlatStyle.Flat;
			this.btnDel.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnDel.Location = new System.Drawing.Point(662, 565);
			this.btnDel.Name = "btnDel";
			this.btnDel.Size = new Size(99, 26);
			this.btnDel.TabIndex = 21;
			this.btnDel.Text = "Xoá đơn [ F8 ]";
			this.btnDel.UseVisualStyleBackColor = true;
			this.btnDel.Click += new EventHandler(this.btnDel_Click);
			this.btnDel.EnabledChanged += new EventHandler(this.btnDel_EnabledChanged);
			this.btnPrint.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnPrint.Cursor = Cursors.Hand;
			this.btnPrint.Enabled = false;
			this.btnPrint.FlatAppearance.BorderColor = Color.FromArgb(192, 192, 255);
			this.btnPrint.FlatStyle = FlatStyle.Flat;
			this.btnPrint.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnPrint.Location = new System.Drawing.Point(557, 565);
			this.btnPrint.Name = "btnPrint";
			this.btnPrint.Size = new Size(102, 26);
			this.btnPrint.TabIndex = 20;
			this.btnPrint.Text = "Xem và in [ F7 ]";
			this.btnPrint.UseVisualStyleBackColor = true;
			this.btnPrint.Click += new EventHandler(this.btnPrint_Click);
			this.btnPrint.EnabledChanged += new EventHandler(this.btnPrint_EnabledChanged);
			this.btnSave.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnSave.Cursor = Cursors.Hand;
			this.btnSave.Enabled = false;
			this.btnSave.FlatAppearance.BorderColor = Color.FromArgb(192, 192, 255);
			this.btnSave.FlatStyle = FlatStyle.Flat;
			this.btnSave.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnSave.Location = new System.Drawing.Point(448, 565);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new Size(106, 26);
			this.btnSave.TabIndex = 19;
			this.btnSave.Text = "Lưu đơn [ F6 ]";
			this.btnSave.UseVisualStyleBackColor = true;
			this.btnSave.Click += new EventHandler(this.btnSave_Click);
			this.btnSave.EnabledChanged += new EventHandler(this.btnSave_EnabledChanged);
			this.btnEdit.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnEdit.Cursor = Cursors.Hand;
			this.btnEdit.Enabled = false;
			this.btnEdit.FlatAppearance.BorderColor = Color.FromArgb(192, 192, 255);
			this.btnEdit.FlatStyle = FlatStyle.Flat;
			this.btnEdit.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnEdit.Location = new System.Drawing.Point(345, 565);
			this.btnEdit.Name = "btnEdit";
			this.btnEdit.Size = new Size(100, 26);
			this.btnEdit.TabIndex = 23;
			this.btnEdit.Text = "Sửa đơn [ F5 ]";
			this.btnEdit.UseVisualStyleBackColor = true;
			this.btnEdit.Click += new EventHandler(this.btnEdit_Click);
			this.btnAdd.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnAdd.Cursor = Cursors.Hand;
			this.btnAdd.FlatAppearance.BorderColor = Color.FromArgb(192, 192, 255);
			this.btnAdd.FlatStyle = FlatStyle.Flat;
			this.btnAdd.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnAdd.Location = new System.Drawing.Point(237, 565);
			this.btnAdd.Name = "btnAdd";
			this.btnAdd.Size = new Size(105, 26);
			this.btnAdd.TabIndex = 1;
			this.btnAdd.Text = "Thêm mới [ F4 ]";
			this.btnAdd.UseVisualStyleBackColor = true;
			this.btnAdd.Click += new EventHandler(this.btnAdd_Click);
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.AllowUserToDeleteRows = false;
			this.dgvProduct.AllowUserToOrderColumns = true;
			this.dgvProduct.AllowUserToResizeColumns = false;
			this.dgvProduct.AllowUserToResizeRows = false;
			dataGridViewCellStyle3.BackColor = Color.White;
			dataGridViewCellStyle3.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
			this.dgvProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvProduct.BackgroundColor = Color.White;
			this.dgvProduct.BorderStyle = BorderStyle.Fixed3D;
			this.dgvProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvProduct.ColumnHeadersVisible = false;
			this.dgvProduct.Columns.AddRange(new DataGridViewColumn[]
			{
				this.productName,
				this.productUnit,
				this.productNumber,
				this.ProductID,
				this.NationalID
			});
			this.dgvProduct.ContextMenuStrip = this.cmsBill;
			this.dgvProduct.Cursor = Cursors.Hand;
			this.dgvProduct.EnableHeadersVisualStyles = false;
			this.dgvProduct.Location = new System.Drawing.Point(233, 142);
			this.dgvProduct.MultiSelect = false;
			this.dgvProduct.Name = "dgvProduct";
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.RowHeadersVisible = false;
			this.dgvProduct.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvProduct.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvProduct.Size = new Size(710, 392);
			this.dgvProduct.TabIndex = 15;
			this.toolTip1.SetToolTip(this.dgvProduct, "Bấm nút phải chuột để chọn\r\nmenu thao tác nhanh !");
			this.dgvProduct.KeyDown += new KeyEventHandler(this.dgvProduct_KeyDown);
			this.dgvProduct.CellEnter += new DataGridViewCellEventHandler(this.dgvProduct_CellEnter);
			this.productName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.productName.DataPropertyName = "productName";
			this.productName.HeaderText = "Sản phẩm";
			this.productName.MinimumWidth = 300;
			this.productName.Name = "productName";
			this.productName.ReadOnly = true;
			this.productName.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.productUnit.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.productUnit.DataPropertyName = "productUnit";
			this.productUnit.HeaderText = "Đơn vị tính";
			this.productUnit.MinimumWidth = 110;
			this.productUnit.Name = "productUnit";
			this.productUnit.ReadOnly = true;
			this.productUnit.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.productUnit.Width = 110;
			this.productNumber.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.productNumber.DataPropertyName = "productNumber";
			dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle4.Format = "N0";
			dataGridViewCellStyle4.NullValue = null;
			this.productNumber.DefaultCellStyle = dataGridViewCellStyle4;
			this.productNumber.HeaderText = "Số lượng";
			this.productNumber.MinimumWidth = 92;
			this.productNumber.Name = "productNumber";
			this.productNumber.ReadOnly = true;
			this.productNumber.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.productNumber.Width = 92;
			this.ProductID.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.ProductID.DataPropertyName = "ProductID";
			this.ProductID.HeaderText = "Mã sản phẩm";
			this.ProductID.Name = "ProductID";
			this.ProductID.ReadOnly = true;
			this.ProductID.Visible = false;
			this.NationalID.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.NationalID.DataPropertyName = "NationalID";
			this.NationalID.HeaderText = "Xuất xứ";
			this.NationalID.MinimumWidth = 200;
			this.NationalID.Name = "NationalID";
			this.NationalID.ReadOnly = true;
			this.NationalID.Width = 205;
			this.cmsBill.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.cmsBill.Items.AddRange(new ToolStripItem[]
			{
				this.cmsAddProduct,
				this.toolStripSeparator4,
				this.cmsDelProduct,
				this.toolStripSeparator1,
				this.cmsAddBill,
				this.cmsEditBill,
				this.toolStripSeparator2,
				this.cmsSaveBill,
				this.cmsPrintBill,
				this.cmsDellBill
			});
			this.cmsBill.Name = "cmsBill";
			this.cmsBill.Size = new Size(257, 176);
			this.cmsAddProduct.Name = "cmsAddProduct";
			this.cmsAddProduct.Size = new Size(256, 22);
			this.cmsAddProduct.Text = "Thêm thuốc vào đơn đặt hàng";
			this.cmsAddProduct.Click += new EventHandler(this.btnSelect_Click);
			this.toolStripSeparator4.Name = "toolStripSeparator4";
			this.toolStripSeparator4.Size = new Size(253, 6);
			this.cmsDelProduct.Name = "cmsDelProduct";
			this.cmsDelProduct.ShortcutKeys = Keys.Delete;
			this.cmsDelProduct.Size = new Size(256, 22);
			this.cmsDelProduct.Text = "Xoá thuốc khỏi đơn đặt hàng";
			this.cmsDelProduct.Click += new EventHandler(this.cmsDelProduct_Click);
			this.toolStripSeparator1.Name = "toolStripSeparator1";
			this.toolStripSeparator1.Size = new Size(253, 6);
			this.cmsAddBill.Name = "cmsAddBill";
			this.cmsAddBill.Size = new Size(256, 22);
			this.cmsAddBill.Text = "Tạo đơn đặt hàng";
			this.cmsAddBill.Click += new EventHandler(this.cmsAddBill_Click);
			this.cmsEditBill.Name = "cmsEditBill";
			this.cmsEditBill.Size = new Size(256, 22);
			this.cmsEditBill.Text = "Sửa đơn đặt hàng";
			this.cmsEditBill.Click += new EventHandler(this.cmsEditBill_Click);
			this.toolStripSeparator2.Name = "toolStripSeparator2";
			this.toolStripSeparator2.Size = new Size(253, 6);
			this.cmsSaveBill.Enabled = false;
			this.cmsSaveBill.Name = "cmsSaveBill";
			this.cmsSaveBill.Size = new Size(256, 22);
			this.cmsSaveBill.Text = "Lưu đơn đặt hàng";
			this.cmsSaveBill.Click += new EventHandler(this.cmsSaveBill_Click);
			this.cmsPrintBill.Enabled = false;
			this.cmsPrintBill.Name = "cmsPrintBill";
			this.cmsPrintBill.Size = new Size(256, 22);
			this.cmsPrintBill.Text = "In đơn đặt hàng";
			this.cmsPrintBill.Click += new EventHandler(this.cmsPrintBill_Click);
			this.cmsDellBill.Enabled = false;
			this.cmsDellBill.Name = "cmsDellBill";
			this.cmsDellBill.Size = new Size(256, 22);
			this.cmsDellBill.Text = "Xoá đơn đặt hàng";
			this.cmsDellBill.Click += new EventHandler(this.cmsDellBill_Click);
			this.groupBox1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox1.Controls.Add(this.cbbProvider);
			this.groupBox1.Controls.Add(this.label5);
			this.groupBox1.Controls.Add(this.txtNote);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.txtDate);
			this.groupBox1.Controls.Add(this.txtID);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox1.Location = new System.Drawing.Point(233, 5);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(710, 80);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Thông tin đơn hàng";
			this.cbbProvider.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbProvider.Cursor = Cursors.Hand;
			this.cbbProvider.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbProvider.FlatStyle = FlatStyle.Flat;
			this.cbbProvider.Font = new Font("Arial", 7.5f, FontStyle.Bold);
			this.cbbProvider.FormattingEnabled = true;
			this.cbbProvider.Location = new System.Drawing.Point(303, 19);
			this.cbbProvider.Name = "cbbProvider";
			this.cbbProvider.Size = new Size(397, 20);
			this.cbbProvider.TabIndex = 29;
			this.label5.AutoSize = true;
			this.label5.BackColor = SystemColors.ButtonFace;
			this.label5.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label5.ForeColor = SystemColors.MenuText;
			this.label5.Location = new System.Drawing.Point(210, 22);
			this.label5.Name = "label5";
			this.label5.Size = new Size(90, 15);
			this.label5.TabIndex = 30;
			this.label5.Text = "Nhà cung cấp :";
			this.label5.TextAlign = ContentAlignment.MiddleRight;
			this.txtNote.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtNote.BackColor = Color.White;
			this.txtNote.Font = new Font("Arial", 9f);
			this.txtNote.Location = new System.Drawing.Point(304, 47);
			this.txtNote.Name = "txtNote";
			this.txtNote.ReadOnly = true;
			this.txtNote.Size = new Size(396, 21);
			this.txtNote.TabIndex = 6;
			this.txtNote.Leave += new EventHandler(this.txtAddress_Leave);
			this.txtNote.Enter += new EventHandler(this.txtAddress_Enter);
			this.label6.AutoSize = true;
			this.label6.BackColor = SystemColors.ButtonFace;
			this.label6.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label6.Location = new System.Drawing.Point(239, 49);
			this.label6.Name = "label6";
			this.label6.Size = new Size(61, 15);
			this.label6.TabIndex = 28;
			this.label6.Text = "Diễn giải :";
			this.label6.TextAlign = ContentAlignment.MiddleRight;
			this.label2.AutoSize = true;
			this.label2.BackColor = SystemColors.ButtonFace;
			this.label2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label2.Location = new System.Drawing.Point(24, 49);
			this.label2.Name = "label2";
			this.label2.Size = new Size(58, 15);
			this.label2.TabIndex = 19;
			this.label2.Text = "Ngày kê :";
			this.label2.TextAlign = ContentAlignment.MiddleRight;
			this.txtDate.CustomFormat = "dd/MM/yyyy";
			this.txtDate.Font = new Font("Arial", 9f);
			this.txtDate.Format = DateTimePickerFormat.Custom;
			this.txtDate.Location = new System.Drawing.Point(86, 46);
			this.txtDate.Name = "txtDate";
			this.txtDate.Size = new Size(104, 21);
			this.txtDate.TabIndex = 2;
			this.txtDate.KeyPress += new KeyPressEventHandler(this.txtDate_KeyPress);
			this.txtID.BackColor = Color.White;
			this.txtID.CharacterCasing = CharacterCasing.Upper;
			this.txtID.Font = new Font("Arial", 9f);
			this.txtID.Location = new System.Drawing.Point(86, 19);
			this.txtID.Name = "txtID";
			this.txtID.ReadOnly = true;
			this.txtID.Size = new Size(104, 21);
			this.txtID.TabIndex = 1;
			this.txtID.Leave += new EventHandler(this.txtID_Leave);
			this.txtID.Enter += new EventHandler(this.txtID_Enter);
			this.label1.AutoSize = true;
			this.label1.BackColor = SystemColors.ButtonFace;
			this.label1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label1.Location = new System.Drawing.Point(14, 22);
			this.label1.Name = "label1";
			this.label1.Size = new Size(69, 15);
			this.label1.TabIndex = 16;
			this.label1.Text = "Đơn hàng :";
			this.label1.TextAlign = ContentAlignment.MiddleRight;
			this.btnSelect.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.btnSelect.BackColor = Color.White;
			this.btnSelect.Enabled = false;
			this.btnSelect.FlatAppearance.BorderColor = Color.Cyan;
			this.btnSelect.FlatStyle = FlatStyle.Flat;
//			this.btnSelect.Image = (Image)componentResourceManager.GetObject("btnSelect.Image");
			this.btnSelect.Location = new System.Drawing.Point(510, 116);
			this.btnSelect.Name = "btnSelect";
			this.btnSelect.Size = new Size(22, 16);
			this.btnSelect.TabIndex = 11;
			this.toolTip1.SetToolTip(this.btnSelect, "Chọn sản phẩm cần xuất");
			this.btnSelect.UseVisualStyleBackColor = false;
			this.btnSelect.Click += new EventHandler(this.btnSelect_Click);
			this.txtProductUnit.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.txtProductUnit.BackColor = Color.White;
			this.txtProductUnit.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductUnit.Location = new System.Drawing.Point(536, 113);
			this.txtProductUnit.Name = "txtProductUnit";
			this.txtProductUnit.ReadOnly = true;
			this.txtProductUnit.Size = new Size(108, 22);
			this.txtProductUnit.TabIndex = 12;
			this.txtProductUnit.TextChanged += new EventHandler(this.txtProductUnit_TextChanged);
			this.txtProductUnit.Leave += new EventHandler(this.txtProductUnit_Leave);
			this.txtProductUnit.KeyPress += new KeyPressEventHandler(this.txtProductUnit_KeyPress);
			this.txtProductUnit.Enter += new EventHandler(this.txtProductUnit_Enter);
			this.txtProductName.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtProductName.BackColor = Color.White;
			this.txtProductName.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductName.Location = new System.Drawing.Point(237, 113);
			this.txtProductName.Name = "txtProductName";
			this.txtProductName.Size = new Size(298, 22);
			this.txtProductName.TabIndex = 10;
			this.txtProductName.TextChanged += new EventHandler(this.txtProductName_TextChanged);
			this.txtProductName.KeyDown += new KeyEventHandler(this.txtProductName_KeyDown);
			this.txtProductName.Leave += new EventHandler(this.txtProductName_Leave);
			this.txtProductName.KeyPress += new KeyPressEventHandler(this.txtProductName_KeyPress);
			this.txtProductName.Enter += new EventHandler(this.txtProductName_Enter);
			this.btnAddToBill.BackColor = Color.White;
			this.btnAddToBill.Enabled = false;
			this.btnAddToBill.FlatAppearance.BorderColor = Color.FromArgb(192, 255, 255);
			this.btnAddToBill.FlatStyle = FlatStyle.Flat;
			this.btnAddToBill.Location = new System.Drawing.Point(36, 546);
			this.btnAddToBill.Name = "btnAddToBill";
			this.btnAddToBill.Size = new Size(140, 2);
			this.btnAddToBill.TabIndex = 200;
			this.btnAddToBill.Text = "Thêm sản phẩm  [ F3 ]";
			this.btnAddToBill.UseVisualStyleBackColor = false;
			this.btnAddToBill.Click += new EventHandler(this.btnAddToBill_Click);
			this.toolTip1.IsBalloon = true;
			this.lblProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.lblProduct.Enabled = false;
			this.lblProduct.FlatAppearance.BorderSize = 0;
			this.lblProduct.FlatStyle = FlatStyle.Flat;
			this.lblProduct.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.lblProduct.Location = new System.Drawing.Point(237, 91);
			this.lblProduct.Name = "lblProduct";
			this.lblProduct.Size = new Size(298, 20);
			this.lblProduct.TabIndex = 178;
			this.lblProduct.Text = "TÊN THUỐC";
			this.lblProduct.UseVisualStyleBackColor = true;
			this.lblMoney.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.lblMoney.Enabled = false;
			this.lblMoney.FlatAppearance.BorderSize = 0;
			this.lblMoney.FlatStyle = FlatStyle.Flat;
			this.lblMoney.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.lblMoney.Location = new System.Drawing.Point(737, 91);
			this.lblMoney.Name = "lblMoney";
			this.lblMoney.Size = new Size(204, 20);
			this.lblMoney.TabIndex = 177;
			this.lblMoney.Text = "XUẤT XỨ";
			this.lblMoney.UseVisualStyleBackColor = true;
			this.lblNumber.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.lblNumber.Enabled = false;
			this.lblNumber.FlatAppearance.BorderSize = 0;
			this.lblNumber.FlatStyle = FlatStyle.Flat;
			this.lblNumber.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.lblNumber.Location = new System.Drawing.Point(645, 91);
			this.lblNumber.Name = "lblNumber";
			this.lblNumber.Size = new Size(91, 20);
			this.lblNumber.TabIndex = 175;
			this.lblNumber.Text = "SỐ LƯỢNG";
			this.lblNumber.UseVisualStyleBackColor = true;
			this.lblUnit.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.lblUnit.Enabled = false;
			this.lblUnit.FlatAppearance.BorderSize = 0;
			this.lblUnit.FlatStyle = FlatStyle.Flat;
			this.lblUnit.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.lblUnit.Location = new System.Drawing.Point(536, 91);
			this.lblUnit.Name = "lblUnit";
			this.lblUnit.Size = new Size(108, 20);
			this.lblUnit.TabIndex = 174;
			this.lblUnit.Text = "ĐƠN VỊ TÍNH";
			this.lblUnit.UseVisualStyleBackColor = true;
			this.label4.BackColor = Color.FromArgb(255, 255, 192);
			this.label4.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label4.Location = new System.Drawing.Point(7, 89);
			this.label4.Name = "label4";
			this.label4.Size = new Size(235, 23);
			this.label4.TabIndex = 172;
			this.label4.Text = "THÔNG TIN VỀ THUỐC :  ";
			this.label4.TextAlign = ContentAlignment.MiddleRight;
			this.label22.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.label22.BackColor = Color.FromArgb(255, 255, 192);
			this.label22.Location = new System.Drawing.Point(233, 89);
			this.label22.Name = "label22";
			this.label22.Size = new Size(710, 50);
			this.label22.TabIndex = 171;
			this.txtProductNumber.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.txtProductNumber.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtProductNumber.Hexadecimal = true;
			this.txtProductNumber.Location = new System.Drawing.Point(645, 113);
            //NumericUpDown arg_2CA1_0 = this.txtProductNumber;
			int[] array = new int[4];
			array[0] = 2000000000;
            txtProductNumber.Maximum = new decimal(array);
			this.txtProductNumber.Name = "txtProductNumber";
			this.txtProductNumber.Size = new Size(91, 22);
			this.txtProductNumber.TabIndex = 13;
			this.txtProductNumber.TextAlign = HorizontalAlignment.Right;
			this.txtProductNumber.ThousandsSeparator = true;
			this.txtProductNumber.Leave += new EventHandler(this.txtProductNumber_Leave);
			this.txtProductNumber.Enter += new EventHandler(this.txtProductNumber_Enter);
			this.txtProductNumber.KeyDown += new KeyEventHandler(this.txtProductNumber_KeyDown);
			this.bindingNavigator1.AddNewItem = null;
			this.bindingNavigator1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.bindingNavigator1.AutoSize = false;
			this.bindingNavigator1.BackColor = Color.White;
			this.bindingNavigator1.CountItem = this.bindingNavigatorCountItem;
			this.bindingNavigator1.CountItemFormat = "/ {0}";
			this.bindingNavigator1.DeleteItem = null;
			this.bindingNavigator1.Dock = DockStyle.None;
			this.bindingNavigator1.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigator1.GripStyle = ToolStripGripStyle.Hidden;
			this.bindingNavigator1.Items.AddRange(new ToolStripItem[]
			{
				this.bindingNavigatorMoveFirstItem,
				this.bindingNavigatorMovePreviousItem,
				this.bindingNavigatorSeparator,
				this.bindingNavigatorPositionItem,
				this.bindingNavigatorCountItem,
				this.bindingNavigatorSeparator1,
				this.bindingNavigatorMoveNextItem,
				this.bindingNavigatorMoveLastItem,
				this.bindingNavigatorSeparator2
			});
			this.bindingNavigator1.Location = new System.Drawing.Point(233, 535);
			this.bindingNavigator1.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
			this.bindingNavigator1.MoveLastItem = this.bindingNavigatorMoveLastItem;
			this.bindingNavigator1.MoveNextItem = this.bindingNavigatorMoveNextItem;
			this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
			this.bindingNavigator1.Name = "bindingNavigator1";
			this.bindingNavigator1.PositionItem = this.bindingNavigatorPositionItem;
			this.bindingNavigator1.RenderMode = ToolStripRenderMode.Professional;
			this.bindingNavigator1.Size = new Size(710, 25);
			this.bindingNavigator1.TabIndex = 201;
			this.bindingNavigator1.Text = "bindingNavigator1";
			this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
			this.bindingNavigatorCountItem.Size = new Size(28, 22);
			this.bindingNavigatorCountItem.Text = "/ {0}";
			this.bindingNavigatorCountItem.ToolTipText = "Total number of items";
			this.bindingNavigatorMoveFirstItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveFirstItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveFirstItem.Image");
			this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
			this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveFirstItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveFirstItem.Text = "Move first";
			this.bindingNavigatorMovePreviousItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMovePreviousItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMovePreviousItem.Image");
			this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
			this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMovePreviousItem.Size = new Size(23, 22);
			this.bindingNavigatorMovePreviousItem.Text = "Move previous";
			this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
			this.bindingNavigatorSeparator.Size = new Size(6, 25);
			this.bindingNavigatorPositionItem.AccessibleName = "Position";
			this.bindingNavigatorPositionItem.AutoSize = false;
			this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
			this.bindingNavigatorPositionItem.Size = new Size(50, 23);
			this.bindingNavigatorPositionItem.Text = "0";
			this.bindingNavigatorPositionItem.ToolTipText = "Current position";
			this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
			this.bindingNavigatorSeparator1.Size = new Size(6, 25);
			this.bindingNavigatorMoveNextItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveNextItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveNextItem.Image");
			this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
			this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveNextItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveNextItem.Text = "Move next";
			this.bindingNavigatorMoveLastItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveLastItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveLastItem.Image");
			this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
			this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveLastItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveLastItem.Text = "Move last";
			this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2";
			this.bindingNavigatorSeparator2.Size = new Size(6, 25);
			this.cbbNational.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.cbbNational.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNational.Enabled = false;
			this.cbbNational.FormattingEnabled = true;
			this.cbbNational.Items.AddRange(new object[]
			{
				"      0%",
				"      5%",
				"    10%"
			});
			this.cbbNational.Location = new System.Drawing.Point(737, 112);
			this.cbbNational.Name = "cbbNational";
			this.cbbNational.Size = new Size(204, 23);
			this.cbbNational.TabIndex = 203;
			this.cbbNational.KeyDown += new KeyEventHandler(this.cbbNational_KeyDown);
			this.lblBottom.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.lblBottom.BackColor = Color.White;
			this.lblBottom.Enabled = false;
			this.lblBottom.FlatAppearance.BorderSize = 0;
			this.lblBottom.FlatStyle = FlatStyle.Flat;
			this.lblBottom.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.lblBottom.Location = new System.Drawing.Point(233, 559);
			this.lblBottom.Name = "lblBottom";
			this.lblBottom.Size = new Size(710, 36);
			this.lblBottom.TabIndex = 204;
			this.lblBottom.UseVisualStyleBackColor = false;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(950, 600);
			base.Controls.Add(this.cbbNational);
			base.Controls.Add(this.bindingNavigator1);
			base.Controls.Add(this.txtProductNumber);
			base.Controls.Add(this.lblProduct);
			base.Controls.Add(this.lblMoney);
			base.Controls.Add(this.btnSelect);
			base.Controls.Add(this.lblUnit);
			base.Controls.Add(this.lblNumber);
			base.Controls.Add(this.txtProductUnit);
			base.Controls.Add(this.label4);
			base.Controls.Add(this.txtProductName);
			base.Controls.Add(this.groupBox1);
			base.Controls.Add(this.groupBox3);
			base.Controls.Add(this.label22);
			base.Controls.Add(this.btnClose);
			base.Controls.Add(this.btnDel);
			base.Controls.Add(this.btnPrint);
			base.Controls.Add(this.btnSave);
			base.Controls.Add(this.btnEdit);
			base.Controls.Add(this.btnAdd);
			base.Controls.Add(this.dgvProduct);
			base.Controls.Add(this.dgvBill);
			base.Controls.Add(this.btnAddToBill);
			base.Controls.Add(this.lblBottom);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmOrder";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "TẠO ĐƠN ĐẶT HÀNG";
			base.Load += new EventHandler(this.frmOrder_Load);
			base.Shown += new EventHandler(this.frmOutputRetailWithDoctor_Shown);
			base.FormClosing += new FormClosingEventHandler(this.frmOutputRetailWithDoctor_FormClosing);
			base.KeyDown += new KeyEventHandler(this.frmOutputRetail_KeyDown);
			this.groupBox3.ResumeLayout(false);
			this.groupBox3.PerformLayout();
			((ISupportInitialize)this.dgvBill).EndInit();
			this.ctmBill.ResumeLayout(false);
			((ISupportInitialize)this.dgvProduct).EndInit();
			this.cmsBill.ResumeLayout(false);
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			((ISupportInitialize)this.txtProductNumber).EndInit();
			((ISupportInitialize)this.bindingNavigator1).EndInit();
			this.bindingNavigator1.ResumeLayout(false);
			this.bindingNavigator1.PerformLayout();
			base.ResumeLayout(false);
			base.PerformLayout();
		}
		public frmOrder()
		{
			this.InitializeComponent();
		}
		private void frmOrder_Load(object sender, EventArgs e)
		{
			this.objFunc.LoadComboBox("SELECT [ID], UPPER(Name) AS Name FROM [TabNational] ORDER BY [Name]", this.cbbNational, "ID", "Name");
			this.objFunc.LoadComboBox("SELECT [CusID] , UPPER(Name) AS Name  FROM [TabPartner] WHERE [IsProvider] = 1", this.cbbProvider, "CusID", "Name");
			this.getBill();
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void frmOutputRetail_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
			else
			{
				if (e.KeyCode == Keys.F2)
				{
					this.btnSelect.PerformClick();
				}
				else
				{
					if (e.KeyCode == Keys.F3)
					{
						this.btnAddToBill.PerformClick();
					}
					else
					{
						if (e.KeyCode == Keys.F4)
						{
							this.btnAdd.PerformClick();
						}
						else
						{
							if (e.KeyCode == Keys.F5)
							{
								this.btnEdit.PerformClick();
							}
							else
							{
								if (e.KeyCode == Keys.F6)
								{
									this.btnSave.PerformClick();
								}
								else
								{
									if (e.KeyCode == Keys.F7)
									{
										this.btnPrint.PerformClick();
									}
									else
									{
										if (e.KeyCode == Keys.F8)
										{
											this.btnDel.PerformClick();
										}
									}
								}
							}
						}
					}
				}
			}
		}
		private void btnSave_Click(object sender, EventArgs e)
		{
			this.objOrder.saveOrder(this.txtID.Text, this.txtDate.Value, this.txtNote.Text, this.cbbProvider.SelectedValue.ToString(), this.userName, this.fullName);
			this.objOrder.saveOrderDetail(this.txtID.Text, this.objProductTable);
			this.getBill();
			this.EnableControl(false);
		}
		private void btnEdit_Click(object sender, EventArgs e)
		{
			this.EnableControl(true);
		}
		private void btnAdd_Click(object sender, EventArgs e)
		{
			DataColumn column = new DataColumn("ProductID", typeof(string));
			DataColumn column2 = new DataColumn("ProductName", typeof(string));
			DataColumn column3 = new DataColumn("ProductUnit", typeof(string));
			DataColumn column4 = new DataColumn("ProductNumber", typeof(string));
			DataColumn column5 = new DataColumn("NationalID", typeof(string));
			this.objProductTable = new DataTable();
			this.objProductTable.Columns.Add(column);
			this.objProductTable.Columns.Add(column2);
			this.objProductTable.Columns.Add(column3);
			this.objProductTable.Columns.Add(column4);
			this.objProductTable.Columns.Add(column5);
			BindingSource bindingSource = new BindingSource();
			bindingSource.DataSource = this.objProductTable;
			this.bindingNavigator1.BindingSource = bindingSource;
			this.dgvProduct.DataSource = bindingSource;
			this.txtNote.Text = "";
			this.EnableControl(true);
			this.currCusID = "0";
			this.txtID.Text = "-:-";
		}
		private void EnableControl(bool Act)
		{
			this.txtID.ReadOnly = !Act;
			this.txtNote.ReadOnly = !Act;
			this.txtNote.ReadOnly = !Act;
			this.btnAddToBill.Enabled = Act;
			this.txtDate.Enabled = Act;
			this.btnSelect.Enabled = Act;
			this.btnSave.Enabled = Act;
		}
		private void btnPrint_Click(object sender, EventArgs e)
		{
			try
			{
				frmOrderBill.objTable = this.objProductTable;
				frmOrderBill.DateCreate = this.txtDate.Text;
				frmOrderBill.Note = this.txtNote.Text;
				frmOrderBill.providerName = this.cbbProvider.Text;
				new frmOrderView
				{
					billID = this.txtID.Text
				}.ShowDialog();
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void btnDel_Click(object sender, EventArgs e)
		{
			if (this.txtID.Text.Trim() != "-:-")
			{
				if (MessageBox.Show("Bạn có chắc chắn muốn xoá hoá đơn [ " + this.txtID.Text.ToUpper() + " ] không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
				{
					this.objOrder.delOrder(this.txtID.Text);
					this.txtNote.Text = "";
					this.EnableControl(true);
					this.currCusID = "0";
					this.txtID.Text = "-:-";
					this.getBill();
				}
			}
		}
		private void btnSelect_Click(object sender, EventArgs e)
		{
			if (this.btnSave.Enabled)
			{
				this.txtProductNumber.Value = 1m;
				this.txtProductName.Text = "";
				this.txtProductUnit.Text = "";
				this.cbbNational.SelectedIndex = 0;
				frmSelectProduct frmSelectProduct = new frmSelectProduct();
				frmSelectProduct.txtSearch.Text = this.txtProductName.Text;
				frmSelectProduct.isInput = true;
				frmSelectProduct.Location = new System.Drawing.Point(this.btnSelect.Location.X - 380, this.btnSelect.Location.Y + 80);
				frmSelectProduct.ShowDialog();
				if (frmSelectProduct.productID != "")
				{
					if (!this.AllowSellSuppen)
					{
						if (this.objProduct.checkForSuppend(frmSelectProduct.productID, "0"))
						{
							MessageBox.Show("Bạn đang chọn mặt thuốc\r\n\r\n" + frmSelectProduct.productName + "\r\n\r\nThuộc danh mục thuốc cấm lưu hành nên không thể nhập kho", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
							return;
						}
					}
					this.currPid = frmSelectProduct.productID;
					this.txtProductName.Text = frmSelectProduct.productName;
					this.txtProductUnit.Text = frmSelectProduct.unitName;
					this.txtProductNumber.Focus();
				}
			}
		}
		private void btnAddToBill_Click(object sender, EventArgs e)
		{
			try
			{
				if (this.txtProductName.Text.Trim() == "")
				{
					MessageBox.Show("Bạn chưa chọn loại thuốc cần kê đơn !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
					this.txtProductName.Focus();
				}
				else
				{
					if (this.txtProductUnit.Text.Trim() == "")
					{
						MessageBox.Show("Bạn chưa chọn đơn vị tính của loại thuốc cần kê đơn !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
						this.txtProductUnit.Focus();
					}
					else
					{
						if (this.txtProductNumber.Text.Trim() == "0")
						{
							MessageBox.Show("Bạn chưa chọn số lượng thuốc cần kê đơn !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
							this.txtProductNumber.Focus();
						}
						else
						{
							int num = this.checkInObjTable(this.currPid);
							if (num == -1)
							{
								this.objProductTable.Rows.Add(new object[]
								{
									this.currPid,
									this.txtProductName.Text,
									this.txtProductUnit.Text,
									this.txtProductNumber.Value.ToString(),
									this.cbbNational.Text
								});
							}
							else
							{
								this.updateObjTable(num);
							}
							this.dgvProduct.DataSource = this.objProductTable;
							this.txtProductName.Text = "";
							this.txtProductUnit.Text = "";
							this.txtProductNumber.Value = 0m;
							this.cbbNational.SelectedIndex = 0;
							this.txtProductName.Focus();
						}
					}
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void updateObjTable(int index)
		{
			this.objProductTable.Rows[index]["ProductID"] = this.currPid;
			this.objProductTable.Rows[index]["ProductName"] = this.txtProductName.Text;
			this.objProductTable.Rows[index]["ProductUnit"] = this.txtProductUnit.Text;
			this.objProductTable.Rows[index]["ProductNumber"] = this.txtProductNumber.Text;
			this.objProductTable.Rows[index]["NationalID"] = this.cbbNational.Text;
		}
		private void txtProductName_TextChanged(object sender, EventArgs e)
		{
		}
		private void getBill()
		{
			try
			{
				this.dgvBill.AutoGenerateColumns = false;
				this.dgvProduct.DataSource = null;
				this.dgvProduct.AutoGenerateColumns = false;
				SqlConnection sqlConnection = new SqlConnection(this.objFunc.strConnectionString);
				string cmdText = "SELECT * FROM [TabOrder] WHERE CreateDate BETWEEN @ObjDate1 AND @objDate2 ORDER BY [CreateDate] DESC";
				SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
				SqlParameter sqlParameter = new SqlParameter("ObjDate1", SqlDbType.DateTime);
				SqlParameter sqlParameter2 = new SqlParameter("ObjDate2", SqlDbType.DateTime);
				sqlParameter.Value = DateTime.Parse(this.dtpFrom.Value.ToString().Substring(0, 10) + " 00:00:00 AM");
				sqlParameter2.Value = DateTime.Parse(this.dtpTo.Value.ToString().Substring(0, 10) + " 11:59:59 PM");
				sqlCommand.Parameters.Add(sqlParameter);
				sqlCommand.Parameters.Add(sqlParameter2);
				SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
				DataSet dataSet = new DataSet();
				sqlConnection.Open();
				sqlDataAdapter.Fill(dataSet);
				this.dgvBill.DataSource = dataSet.Tables[0];
				sqlConnection.Close();
				sqlConnection.Dispose();
				sqlDataAdapter.Dispose();
				dataSet.Dispose();
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void txtProductUnit_TextChanged(object sender, EventArgs e)
		{
		}
		private void txtProductPrice_TextChanged(object sender, EventArgs e)
		{
			this.objFunc.txtObject_Leave(sender);
		}
		private void txtProductNumber_TextChanged(object sender, EventArgs e)
		{
		}
		private void txtProductMoney_TextChanged(object sender, EventArgs e)
		{
			this.objFunc.txtObject_Leave(sender);
		}
		private void dgvBill_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				this.objProductTable = new DataTable();
				this.txtID.Text = this.dgvBill.Rows[e.RowIndex].Cells["ID"].Value.ToString();
				this.txtDate.Value = DateTime.Parse(this.dgvBill.Rows[e.RowIndex].Cells["CreateDate"].Value.ToString());
				this.txtNote.Text = this.dgvBill.Rows[e.RowIndex].Cells["Note"].Value.ToString();
				this.cbbProvider.SelectedValue = this.dgvBill.Rows[e.RowIndex].Cells["PID"].Value.ToString();
				this.objProductTable = this.objOrder.getOrderDetail(this.txtID.Text);
				BindingSource bindingSource = new BindingSource();
				bindingSource.DataSource = this.objProductTable;
				this.bindingNavigator1.BindingSource = bindingSource;
				this.dgvProduct.DataSource = bindingSource;
				this.btnSave.Enabled = false;
				this.btnEdit.Enabled = true;
				this.btnDel.Enabled = true;
				this.btnPrint.Enabled = true;
				this.txtNote.ReadOnly = true;
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void dgvProduct_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				if (e.RowIndex != -1 && this.btnSave.Enabled)
				{
					this.currIndex = e.RowIndex;
					this.currPid = this.dgvProduct.Rows[e.RowIndex].Cells["ProductID"].Value.ToString();
					this.txtProductName.Text = this.dgvProduct.Rows[e.RowIndex].Cells["ProductName"].Value.ToString();
					this.txtProductUnit.Text = this.dgvProduct.Rows[e.RowIndex].Cells["ProductUnit"].Value.ToString();
					this.txtProductNumber.Text = this.dgvProduct.Rows[e.RowIndex].Cells["ProductNumber"].Value.ToString();
					this.cbbNational.Text = this.dgvProduct.Rows[e.RowIndex].Cells["NationalID"].Value.ToString();
				}
			}
			catch
			{
			}
		}
		private void dgvProduct_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Delete && this.btnSave.Enabled)
			{
				this.objProductTable.Rows[this.currIndex].Delete();
				this.dgvProduct.Refresh();
			}
		}
		private void cbbPacket_SelectedIndexChanged(object sender, EventArgs e)
		{
		}
		private void dtpSelectMonth_ValueChanged(object sender, EventArgs e)
		{
		}
		private void txtBarcode_TextChanged(object sender, EventArgs e)
		{
		}
		private void btnSearch_Click(object sender, EventArgs e)
		{
		}
		private void btnViewAll_Click(object sender, EventArgs e)
		{
		}
		private void txtProductNumber_Leave(object sender, EventArgs e)
		{
			this.txtProductNumber.BackColor = Color.White;
		}
		private void txtProductMoney_Leave(object sender, EventArgs e)
		{
			this.objFunc.txtObject_Leave(sender);
		}
		private void txtBalancer_Leave(object sender, EventArgs e)
		{
			this.objFunc.txtObject_Leave(sender);
		}
		private void txtTotalMoney_Leave(object sender, EventArgs e)
		{
			this.objFunc.txtObject_Leave(sender);
		}
		private void txtTotalMoney_TextChanged(object sender, EventArgs e)
		{
			this.objFunc.txtObject_Leave(sender);
		}
		private void btnFind_Click(object sender, EventArgs e)
		{
			frmFindCustomerFree frmFindCustomerFree = new frmFindCustomerFree();
			frmFindCustomerFree.ShowDialog();
			if (frmFindCustomerFree._Name.Trim() != "")
			{
				this.txtNote.Text = frmFindCustomerFree._Address;
			}
		}
		private void btnListUnit_Click(object sender, EventArgs e)
		{
		}
		private void txtBarcode_KeyDown(object sender, KeyEventArgs e)
		{
		}
		private void cmsAddBill_Click(object sender, EventArgs e)
		{
			this.btnAdd.PerformClick();
		}
		private void cmsEditBill_Click(object sender, EventArgs e)
		{
			this.btnEdit.PerformClick();
		}
		private void cmsSaveBill_Click(object sender, EventArgs e)
		{
			this.btnSave.PerformClick();
		}
		private void cmsPrintBill_Click(object sender, EventArgs e)
		{
			this.btnPrint.PerformClick();
		}
		private void cmsDellBill_Click(object sender, EventArgs e)
		{
			this.btnDel.PerformClick();
		}
		private void btnSave_EnabledChanged(object sender, EventArgs e)
		{
			this.cmsAddProduct.Enabled = this.btnSave.Enabled;
			this.cmsSaveBill.Enabled = this.btnSave.Enabled;
			this.cmsDelProduct.Enabled = this.btnSave.Enabled;
			this.txtProductName.ReadOnly = !this.btnSave.Enabled;
			this.txtProductNumber.ReadOnly = !this.btnSave.Enabled;
			this.txtProductUnit.ReadOnly = !this.btnSave.Enabled;
			this.cbbNational.Enabled = this.btnSave.Enabled;
		}
		private void btnDel_EnabledChanged(object sender, EventArgs e)
		{
			this.cmsDellBill.Enabled = this.btnDel.Enabled;
		}
		private void btnPrint_EnabledChanged(object sender, EventArgs e)
		{
			this.cmsPrintBill.Enabled = this.btnPrint.Enabled;
		}
		private void txtProductNumber_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Return)
			{
				this.cbbNational.Focus();
			}
		}
		private void txtProductName_KeyPress(object sender, KeyPressEventArgs e)
		{
		}
		private void txtProductUnit_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtProductNumber.Focus();
			}
		}
		private void cbbPacket_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtProductUnit.Focus();
			}
		}
		private void txtProductPrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtProductNumber.Focus();
			}
		}
		private void txtProductNumber_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.btnAddToBill.PerformClick();
			}
		}
		private void cbbSex_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtNote.Focus();
			}
		}
		private void txtDate_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtNote.Focus();
			}
		}
		private void txtNote_KeyPress(object sender, KeyPressEventArgs e)
		{
		}
		private void txtDoctor_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtProductName.Focus();
			}
		}
		private void txtProductName_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyData == Keys.Down)
			{
				if (this.txtProductName.Text.Trim() != "")
				{
					this.btnSelect.PerformClick();
				}
			}
			else
			{
				if (e.KeyData == Keys.Return)
				{
					if (this.txtProductName.Text.Trim() == "")
					{
						this.btnSelect.PerformClick();
					}
					else
					{
						this.txtProductUnit.Focus();
					}
				}
			}
		}
		private void txtID_Enter(object sender, EventArgs e)
		{
			this.txtID.BackColor = Color.Aqua;
		}
		private void txtID_Leave(object sender, EventArgs e)
		{
			this.txtID.BackColor = Color.White;
		}
		private void txtAddress_Enter(object sender, EventArgs e)
		{
			this.txtNote.BackColor = Color.Aqua;
		}
		private void txtAddress_Leave(object sender, EventArgs e)
		{
			this.txtNote.BackColor = Color.White;
		}
		private void txtProductName_Enter(object sender, EventArgs e)
		{
			this.txtProductName.BackColor = Color.Aqua;
		}
		private void txtProductName_Leave(object sender, EventArgs e)
		{
			this.txtProductName.BackColor = Color.White;
		}
		private void txtProductUnit_Enter(object sender, EventArgs e)
		{
			this.txtProductUnit.BackColor = Color.Aqua;
		}
		private void txtProductUnit_Leave(object sender, EventArgs e)
		{
			this.txtProductUnit.BackColor = Color.White;
		}
		private void txtProductPrice_Enter(object sender, EventArgs e)
		{
		}
		private void txtProductPrice_Leave(object sender, EventArgs e)
		{
		}
		private void txtProductNumber_Enter(object sender, EventArgs e)
		{
			this.txtProductNumber.BackColor = Color.Aqua;
		}
		private void frmOutputRetailWithDoctor_FormClosing(object sender, FormClosingEventArgs e)
		{
			if (this.btnSave.Enabled)
			{
				if (MessageBox.Show("Bạn có muốn ghi lại thông tin về hoá đơn hiện tại không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
				{
					e.Cancel = true;
					this.btnSave.PerformClick();
				}
			}
		}
		private void frmOutputRetailWithDoctor_Shown(object sender, EventArgs e)
		{
			this.btnAdd.PerformClick();
			if (frmMakeOrderBill.objTableOrder != null)
			{
				if (frmMakeOrderBill.objTableOrder.Rows.Count > 0)
				{
					this.objProductTable = new DataTable();
					this.objProductTable = frmMakeOrderBill.objTableOrder;
					BindingSource bindingSource = new BindingSource();
					bindingSource.DataSource = this.objProductTable;
					this.bindingNavigator1.BindingSource = bindingSource;
					this.dgvProduct.DataSource = bindingSource;
					frmMakeOrderBill.objTableOrder = null;
					this.txtNote.Text = "";
					this.EnableControl(true);
					this.currCusID = "0";
					this.txtID.Text = "-:-";
				}
			}
		}
		private void btnSearchTime_Click(object sender, EventArgs e)
		{
			this.getBill();
		}
		private void txtMoney_TextChanged(object sender, EventArgs e)
		{
		}
		private void txtDiscountOut_TextChanged(object sender, EventArgs e)
		{
		}
		private void txtDiscountOut_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.btnSave.PerformClick();
			}
		}
		private void txtMoneyAfterDiscount_Leave(object sender, EventArgs e)
		{
		}
		private void ctmBillAdd_Click(object sender, EventArgs e)
		{
			this.btnAdd.PerformClick();
		}
		private void ctmBillEdit_Click(object sender, EventArgs e)
		{
			this.btnEdit.PerformClick();
		}
		private void ctmBillPrint_Click(object sender, EventArgs e)
		{
			this.btnPrint.PerformClick();
		}
		private void ctmBillDel_Click(object sender, EventArgs e)
		{
			this.btnDel.PerformClick();
		}
		private int checkInObjTable(string Pid)
		{
			int num = -1;
			int result;
			for (int i = 0; i < this.objProductTable.Rows.Count; i++)
			{
				if (this.objProductTable.Rows[i]["ProductID"].ToString() == Pid)
				{
					num = i;
					result = num;
					return result;
				}
			}
			result = num;
			return result;
		}
		private void cmsDelProduct_Click(object sender, EventArgs e)
		{
			if (this.btnSave.Enabled)
			{
				try
				{
					this.objProductTable.Rows[this.currIndex].Delete();
					this.dgvProduct.Refresh();
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message);
				}
			}
		}
		private void cbbNational_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyData == Keys.Return)
			{
				this.btnAddToBill.PerformClick();
			}
		}
	}
}
